A Compiler for Constraint Handling Rules based onPartial
نویسنده
چکیده
We argue to base the compilation of a particular language for writing constraint solvers, CHR, on partial evaluation (PE). In contrast to previous compilers realizations the semantics of the generated code are easier to prove to correspond to the intended ones and we can capitalize on the possibility to control the degree of PE, which allows for everything between interpreted execution to full compilation. The resulting diierences in execution speed and code size are subject to a tradeoo made and controlled by the user through compiler opotions. Further, PE based compilation prepares a next step in the evolution of CHR implementations where the realization of parts of the constraint store will be made available to the PE process. The specialization of the abstract data types that make up the constraint store is instrumental in narrowing the performance gap between special purpose constraint solvers and CHR.
منابع مشابه
Compiling Constraint Handling Rules into Prolog with Attributed Variables
We introduce the most recent and advanced implementation of constraint handling rules (CHR) in a logic programming language, which improves both on previous implementations (in terms of completeness , exibility and eeciency) and on the principles that should guide such a Prolog implementation consisting of a runtime system and a compiler. The runtime system utilizes attributed variables for the...
متن کاملMemory Reuse for CHR
Two Constraint Handling Rules compiler optimizations that drastically reduce the memory footprint of CHR programs are introduced. The reduction is the result of reusing suspension terms, the internal CHR constraint representation, and avoiding the overhead of constraint removal followed by insertion. The optimizations are defined formally and their correctness is proved. Both optimizations were...
متن کاملFrom Attribute Grammars to Constraint Handling Rules
Attribute grammars provide a framework to define computations over trees, by decorating those trees with attributes. Attribute grammars have been successfully applied in many areas, including compiler construction and natural language processing. In this paper we present a translation of attribute grammars to Constraint Handling Rules, a formalism based on constraint rewriting. Our translation ...
متن کاملVisualization of CHR through Source-to-Source Transformation
In this paper, we propose an extension of Constraint Handling Rules (CHR) with different visualization features. One feature is to visualize the execution of rules applied on a list of constraints. The second feature is to represent some of the CHR constraints as objects and visualize the effect of CHR rules on them. To avoid changing the compiler, our implementation is based on source-to-sourc...
متن کاملTranslating Constraint Handling Rules into Action Rules
CHR is a popular high-level language for implementing constraint solvers and other general purpose applications. It has a wellestablished operational semantics and quite a number of different implementations, prominently in Prolog. However, there is still much room for exploring the compilation of CHR to Prolog. Nearly all implementations rely on attributed variables. In this paper, we explore ...
متن کامل